﻿using System;
using UnityEngine;
using UnityEngine.Networking;

[RequireComponent(typeof(Character))]
public class CharacterBehaviour : NetworkBehaviour
{
    private Character m_self;

    protected virtual void Awake()
    {
    }

    public override void OnDeserialize(NetworkReader reader, bool initialState)
    {
    }

    public override bool OnSerialize(NetworkWriter writer, bool forceAll)
    {
        bool flag;
        return flag;
    }

    private void UNetVersion()
    {
    }

    public bool isAI
    {
        get
        {
            return (base.tag != GameTags.Player);
        }
    }

    public bool isMonster
    {
        get
        {
            return (base.tag == GameTags.Monster);
        }
    }

    public bool isPlayer
    {
        get
        {
            return (base.tag == GameTags.Player);
        }
    }

    public Life life
    {
        get
        {
            return this.self.life;
        }
    }

    public Character self
    {
        get
        {
            return ((this.m_self == null) ? (this.m_self = base.GetComponent<Character>()) : this.m_self);
        }
    }
}

